home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / cshell / globals.c < prev    next >
C/C++ Source or Header  |  1994-02-13  |  6KB  |  147 lines

  1. /*
  2.  * GLOBALS.C
  3.  *
  4.  * (c)1986 Matthew Dillon     9 October 1986
  5.  *
  6.  *    Most global variables.
  7.  *
  8.  * Version 2.07M by Steve Drew 10-Sep-87
  9.  * Version 4.01A by Carlo Borreo & Cesare Dieni 17-Feb-90
  10.  * Version 5.00L by Urban Mueller 17-Feb-91
  11.  * Version 5.20L by Andreas M. Kirchwitz (Fri, 13 Mar 1992)
  12.  *
  13.  */
  14.  
  15. #include "shell.h"
  16.  
  17. char v_titlebar    []="_titlebar";    /* Window title                */
  18. char v_prompt    []="_prompt";    /* your prompt (ascii command)        */
  19. char v_hist    []="_history";    /* set history depth (value)        */
  20. char v_histnum    []="_histnum";    /* set history numbering var        */
  21. char v_debug    []="_debug";    /* set debug mode            */
  22. char v_verbose    []="_verbose";    /* set verbose for source files        */
  23. char v_stat    []="_maxerr";    /* worst return value to date        */
  24. char v_lasterr    []="_lasterr";    /* return value from last comm.        */
  25. char v_cwd    []="_cwd";    /* current directory            */
  26. char v_except    []="_except";    /* "nnn;command"            */
  27. char v_every    []="_every";    /* executed before prompt        */
  28. char v_passed    []="_passed";    /* passed arguments to source file    */
  29. char v_path    []="_path";    /* search path for external commands    */
  30. char v_gotofwd    []="_gtf";    /* set name for fwd goto name        */
  31. char v_linenum    []="_linenum";    /* name for forline line #        */
  32. char v_lcd    []="_lcd";    /* last current directory        */
  33. char v_rxpath    []="_rxpath";    /* path for .rexx commands        */
  34. char v_hilite    []="_hilite";    /* hilighting escape sequence        */
  35. char v_scroll    []="_scroll";    /* scroll jump in fast mode        */
  36. char v_minrows    []="_minrows";    /* minimum # of rows for fast scroll    */
  37. char v_result    []="_result";    /* result from rxsend            */
  38. char v_qcd    []="_qcd";    /* file name for csh-qcd        */
  39. char v_noreq    []="_noreq";    /* turn off system requesters        */
  40. char v_value    []="_value";    /* return value of a function        */
  41. char v_nobreak    []="_nobreak";    /* disabling of ^C            */
  42. char v_bground    []="_bground";    /* started in background        */
  43. char v_pipe    []="_pipe";    /* path for pipes            */
  44. char v_datefmt    []="_datefmt";    /* format of dates            */
  45. char v_ioerr    []="_ioerr";    /* last secondary result        */
  46. char v_abbrev    []="_abbrev";    /* disable command abbreviations    */
  47. char v_rback    []="_rback";    /* command to be used for '&'        */
  48. char v_insert    []="_insert";    /* insert mode                */
  49. char v_failat    []="_failat";    /* batch file fail level        */
  50. char v_clipri    []="_clipri";    /* command line priority        */
  51. char v_dirformat[]="_dirformat";/* format string for "dir" command    */
  52. char v_nomatch    []="_nomatch";    /* abort if pattern doesn't match    */
  53. char v_prghash    []="_prghash";    /* file for program hash table        */
  54. char v_cquote    []="_cquote";    /* commodore-shell compatible quotes    */
  55.  
  56. HIST *H_head, *H_tail;    /* HISTORY lists */
  57.  
  58. PERROR Perror[]= {    /* error code->string */
  59.     103,    "Insufficient free storage",
  60.     105,    "Task table full",
  61.     120,    "Argument line invalid or too long",
  62.     121,    "File is not an object module",
  63.     122,    "Invalid resident library during load",
  64.     201,    "No default directory",
  65.     202,    "Object in use",
  66.     203,    "Object already exists",
  67.     204,    "Directory not found",
  68.     205,    "Object not found",
  69.     206,    "Bad stream name",
  70.     207,    "Object too large",
  71.     209,    "Action not known",
  72.     210,    "Invalid stream component name",
  73.     211,    "Invalid object lock",
  74.     212,    "Object not of required type",
  75.     213,    "Disk not validated",
  76.     214,    "Disk write protected",
  77.     215,    "Rename across devices",
  78.     216,    "Directory not empty",
  79.     217,    "Too many levels",
  80.     218,    "Device not mounted",
  81.     219,    "Seek error",
  82.     220,    "Comment too long",
  83.     221,    "Disk full",
  84.     222,    "File delete protected",
  85.     223,    "File write protected",
  86.     224,    "File read protected",
  87.     225,    "Not a DOS disk",
  88.     226,    "No disk in drive",
  89.  
  90.  /* custom error messages */
  91.  
  92.     500,    "Bad arguments",
  93.     501,    "Label not found",
  94.     502,    "Must be within source file",
  95.     503,    "Syntax Error",
  96.     504,    "Redirection error",
  97.     505,    "Pipe error",
  98.     506,    "Too many arguments",
  99.     507,    "Destination not a directory",
  100.     508,    "Cannot mv a filesystem",
  101.     509,    "Error in command name",
  102.     510,    "Bad drive name",
  103.     511,    "Illegal number",
  104.     512,    "Out of memory",
  105.     513,    "User interrupt",
  106.     0,    NULL
  107. };
  108.  
  109. char **av;                    /* Internal argument list                */
  110. FILE *Src_base[MAXSRC];        /* file pointers for source files        */
  111. long  Src_pos[MAXSRC];        /* seek position storage for same        */
  112. short Src_if[MAXSRC];        /* the if level at batch file start        */
  113. short Src_abort[MAXSRC];    /* abort this batch file                */
  114. char If_base[MAXIF];        /* If/Else stack for conditionals        */
  115. int H_len, H_tail_base;        /* History associated stuff                */
  116. int H_stack, H_num;            /* AddHistory disable stack                */
  117. int E_stack;                /* Exception disable stack                */
  118. int Src_stack, If_stack;    /* Stack Indexes                        */
  119. int forward_goto;            /* Flag for searching for foward lables    */
  120. int ac;                        /* Internal argc                        */
  121. int max_ac=256;                /* Maximum # of args (increasable)        */
  122. int debug;                    /* Debug mode                            */
  123. int disable;                /* Disable com. execution (conditionals)*/
  124. int Verbose;                /* Verbose mode for source files        */
  125. int Lastresult;                /* Last return code                        */
  126. int Exec_abortline;            /* flag to abort rest of line            */
  127. int Quit;                    /* Quit flag                            */
  128. char stdin_redir;            /* stdin is redirected                    */
  129. char stdout_redir;            /* stdout is redirected                    */
  130. char *MyMem;
  131. struct Process *Myprocess = NULL;    /* CSH's process */
  132. struct Window *Mywindow = NULL;        /* CSH's window, may be NULL! */
  133. struct CommandLineInterface *Mycli;
  134. struct DosPacket *Mypacket;
  135. int S_histlen = 20;            /* Max # history entries                */
  136.  
  137. unsigned int options;
  138. char Buf[280], confirmed, asked;
  139. CLASS *CRoot, *LastCRoot;
  140.  
  141. long IoError;
  142.  
  143. /* internal programm path hash-list */
  144. char **prghash_list = NULL;
  145. long prghash_num = 0L;
  146.  
  147.